<%@page import="aex.domain.Article"%>
<%@page import="aex.domain.Puser"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE>
<html>
<head>

<base href="<%=basePath%>">
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<!--  -->
<!--[if lt IE 9]>
<script type="text/javascript" src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
<script type="text/javascript" src="http://libs.useso.com/js/respond.js/1.4.2/respond.min.js"></script>
<script type="text/javascript" src="http://cdn.bootcss.com/css3pie/2.0beta1/PIE_IE678.js"></script>
<![endif]-->
<!--[if IE 7]>
<link href="http://www.bootcss.com/p/font-awesome/assets/css/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 6]>
<script type="text/javascript" src="systemJs/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
	<link rel="stylesheet" type="text/css" href="systemStyle/H-ui.css">
<link rel="stylesheet" type="text/css" href="expandStyle/aex_userPage.css">
<link rel="stylesheet" type="text/css" href="expandStyle/index.css" />
<link rel="stylesheet" type="text/css" href="expandStyle/article.css" />
<link rel="stylesheet" type="text/css" href="expandStyle/comment.css" />


<script type="text/javascript" src="http://libs.useso.com/js/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="systemJs/aex_userPage.js"></script>



<title>${webTitle}网站管理后台</title>
</head>

<body>
	
	
	
	<!--导航栏-->
    
    <%
    	Puser user=(Puser)request.getSession().getAttribute("user");
    	if(user==null){
    		%>
    			<jsp:include page="/systemPage/headNavVisitor1.jsp"></jsp:include>		
    		<%
    	}else{
    		%>
				<jsp:include page="/systemPage/headNavVisitor2.jsp"></jsp:include>
    		<%
    	}
    %>
    
	
	
	<!--主要内容-->
  <div class="container">
  	 <div class="container_left">
  	     <!--当前位置-->
         <div id="place_here">
            当前位置 > <a href="#">广场</a> > 
            <c:if test="${art.articleCategory.acName  ne '官方小组' }">
            	<a href="visitor/visitor_showCategory.do?id=${art.articleCategory.acId }">${art.articleCategory.acName }</a>
            </c:if>
            
            
         </div>
         <!--文章-->
         <div id="article_box">
            <h2>${art.arTitle }</h2>
            <div class="article_info">
              	<span>浏览量: ${art.arViewCount }</span>
              	<span id="author">&nbsp; &nbsp;：${art.puser.puName  }</span>
              	<span id="time">&nbsp; &nbsp;：${art.arTime}</span>
            </div>
            <!--分享-->
            <div class="bdsharebuttonbox" id="share_Id">
                <a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone"></a><a href="#" class="bds_tsina" data-cmd="tsina"></a><a href="#" class="bds_tqq" data-cmd="tqq"></a><a href="#" class="bds_renren" data-cmd="renren"></a><a href="#" class="bds_weixin" data-cmd="weixin"></a>
              </div>
              <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=1244693285.js?cdnversion='+~(-new Date()/36e5)];</script>

              <!--正文-->
              <div class="article">${art.arContent }</div>
               <div class='article_message'>
              	<%
              		Article art=(Article)request.getAttribute("art");
              		if(user!=null&&user.getPuId().equals(art.getPuser().getPuId())){
              			out.print("<span>管理：</span> <a href='user/user_goUserEditorArticle.do?id="+art.getArId()+"'>编辑</a>"+
              			"<a href='user/user_deleteArticle.do?id="+art.getArId()+"'>删除</a>");
              		}
              	%>
              </div>
              
              
              <div class="like_article" onclick="totop()" >喜欢(<a id='top' href="javascript:void(0)" >${art.arLike }</a>)</div>
              
             
              <div class="page_article">
                <c:if test="${prev eq null }" >
						<p><a href="javascript:;;">上一篇:没有了</a></p>
					</c:if>
					<c:if test="${prev ne null }" >
						<p><a href="visitor/visitor_article.do?arId=${prev.arId }">上一篇:${prev.arTitle }</a></p>
					</c:if>
					<c:if test="${next eq null }" >
						<p><a href="javascript:;;">下一篇:没有了</a></p>
					</c:if>
					<c:if test="${next ne null }" >
						<p><a href="visitor/visitor_article.do?arId=${next.arId }">下一篇:${next.arTitle }</a></p>
					</c:if>
              </div>
         </div>

         <%--文章可以评论 --%>
			
			<div class="comment_article">
				<div class="comment_tittle">评论：</div>
				<div class="comment_contentBox" style="margin-bottom: 100px;">
				 <c:forEach var="com" items="${pageBean.objList }">
					<%-- 文章的评论  --%>
					
						<div class="tourist">
							<img alt="" width="50" height="50" src="${com.puser.puPhoto}">
							 <div><a href="#">${com.puser.puName}</a></div>
						</div>
						<div class="comment_content">
							<div class="c_contentTop">${com.caCount }</div>
							<div class="c_contentDown">
								<span href="#">${com.puser.puName }</span> <span href="#"
									id="time">&nbsp; &nbsp;：<fmt:formatDate
										value="${com.caTime }" pattern="yy-MM-dd"></fmt:formatDate></span> <a
									onclick="replay(${com.caId})" id="return_a" >&nbsp; &nbsp; &nbsp;回复</a>
							</div>
						</div>
					<%-- 评论的评论  --%>
					<c:forEach var="com_com" items="${com.commentArticles }">
						<div class="comment_content">
								<div class="c_contentTop c_contentTop1">${com_com.caCount }</div>
								<div class="c_contentDown">
									<span href="#">${com_com.puser.puName }</span> <span href="#"
										id="time">&nbsp; &nbsp;：<fmt:formatDate
											value="${com_com.caTime }" pattern="yy-MM-dd"></fmt:formatDate></span>
									<a  onclick="replay(${com_com.caId})" id="return_a" >&nbsp; &nbsp; &nbsp;回复</a>
								</div>
							</div>
							<div class="tourist">
								<img alt="" width="50" height="50"
									src="${com_com.puser.puPhoto}">
								<div><a href="#">${com_com.puser.puName}</a></div>
							</div>
					</c:forEach>
				</c:forEach>
				</div>
			<!--页数-->
      		 <jsp:include page="/systemPage/paginationVisitor.jsp"></jsp:include>
				
				
				
				
				
				<div class="play_comment">
				<div class="comment_tittle">发表评论</div>
				<form id="mf1"
					action="visitor/visitor_addComment.do?arId=${art.arId }"
					method="post">
				<a name='anchor' href="javascripr:void(0);"></a>
					<textarea name='comment' id="c_text"></textarea>
					<input type="button" onclick="check()" class="button"
						id="p_comment" value="评论">
				</form>
				<script type="text/javascript">
				
				function totop(){
					
					$.get('visitor/visitor_top.do?arId=${art.arId}',null,function(data){
						if(data!="ok"){
							alert("每天只点一次！");
						}else{
							var mun=$("#top").html();
							var n=parseInt(mun)+1;
							$("#top").html(n);
							
						}
					});
				}
				
				
					function check() {
						var str = $('#c_text').val();
						if (str.trim().length < 1) {
							alert("请输入评论内容！");
						} else {
							$("#mf1").submit();
						}
					}
					
					function replay(id){
						var url=$("#mf1").attr("action");
						var index=url.indexOf('&');
						if(index==-1){
							url+='&acId='+id;
						}else{
							url=url.substring(0,index)+'&acId='+id
						}
						$("#mf1").attr("action",url);
						location.hash="anchor";
					}
					
					
				</script>
			</div>
		</div>
		</div>	
			
			<a name="anchor"></a>
			
		
		
	
  	 
  	 	 <jsp:include page="/systemPage/cbl1.jsp"></jsp:include>
  	 </div>
	<jsp:include page="/systemPage/footerVisitor.jsp"></jsp:include>
</body>

</html>
